﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="CommonMenuManagement.ascx.cs" Inherits="admin_webparts_Plug_ins_CommonPage_CommonMenuManagement" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="NTTHAO.CommonWeb" %>
<%@ Import Namespace="NTTHAO.Common.BL" %>
<%@ Import Namespace="NTTHAO.Web.BL.CommonPage" %>

<div class="tip" style="min-height: 22px; overflow: hidden;">
    <table cellpadding="0" cellspacing="0" border="0" width="100%">
        <tr>
            <td align="left">
                <h2 style="padding-top: 2px;"><%=LanguageUtility.GetLanguageText("MANAGE_SUB_NEMU", Session)%>: <%=(this._Menu == null ? LanguageUtility.GetLanguageText("COMMON_CONTENT", Session) : this._Menu.Text)%></h2>
            </td>
            <td align="right" style="white-space: nowrap;">
                <%if (this._Menu != null || this._IsAdminLogged) { %>
                <span id="spLinkAdd" class="yui-button yui-link-button yuibtn yuibtn-icon btnaddf"><span class="first-child"><a href="?action=addmnu&g=<%=this.Request.QueryString["g"] %>&mnuid=<%=this.Request.QueryString["mnuid"] %>&time=<%=DateTime.Now.Ticks.ToString() %>&ReturnUrl=<%=_ReturnUrl %>"><%=LanguageUtility.GetLanguageText("ADD_SUB_MENU", Session)%></a></span></span>
                <%} %>
                <span id="spBack" class="yui-button yui-link-button yuibtn yuibtn-icon btnundo"><span class="first-child"><a href="?action=view&g=<%=this.Request.QueryString["g"] %>&mnuid=<%=this.Request.QueryString["mnuid"] %>&time=<%=DateTime.Now.Ticks.ToString() %>"><%=LanguageUtility.GetLanguageText("BACK", Session)%></a></span></span>
            </td>
        </tr>
    </table>
    <script type="text/javascript">
        YAHOO.util.Event.onDOMReady(function () {
            var spLinkAdd = new YAHOO.widget.Button("spLinkAdd");
            var spBack = new YAHOO.widget.Button("spBack");
        });
    </script>
</div>
<table cellspacing="0" cellpadding="0" border="0" width="100%" style="margin-bottom: 10px;">
    <tr>
        <td class="b blue"><%=LanguageUtility.GetLanguageText("SUB_MENU", Session)%>:</td>
    </tr>
</table>
<table id="tbGrid" class="grid" border="1" cellpadding="0" cellspacing="0">
    <tr>
        <th width="42px">#</th>
        <th><%=LanguageUtility.GetLanguageText("NAME", Session)%></th>
        <th><%=LanguageUtility.GetLanguageText("ACTIVE", Session)%></th>
        <th width="42px"><%=LanguageUtility.GetLanguageText("ACTION", Session)%></th>
    </tr>
<%if (_List != null)
{
    for (int i = 0; i < _List.Rows.Count; i++)
    {
        DataRow row = _List.Rows[i];
        int id = (int)row[CommonMenu.ID__COLUMN_NAME];
        int parentID = (int)row[CommonMenu.PARENTID__COLUMN_NAME];
        string text = row[CommonMenu.TEXT__COLUMN_NAME].ToString();
        int actived = (int)row[CommonMenu.ACTIVE__COLUMN_NAME];
%>
    <tr class="<%=(i%2==1?"even":"odd") %>">
        <td align="center"><%=i+1 %></td>
        <td><%=text %></td>
        <td align="center"><%=(actived == 1 ? "<img src=\"resources/images/active.png\" />" : "<img src=\"resources/images/inactive.png\" />")%></td>
        <td align="center">
            <ul class="icon" style="width: 140px;">
                <li><a title="<%=LanguageUtility.GetLanguageText("MOVE_UP", Session)%>" href="CommonPageContent.aspx?action=moveupmenu&g=<%=this.Request.QueryString["g"] %>&parentid=<%=parentID %>&mnuid=<%=id %>&ReturnUrl=<%=_ReturnUrl %>" class="icon ascbn">&nbsp</a></li>
                <li><a title="<%=LanguageUtility.GetLanguageText("MOVE_DOWN", Session)%>" href="CommonPageContent.aspx?action=movedownmenu&g=<%=this.Request.QueryString["g"] %>&parentid=<%=parentID %>&mnuid=<%=id %>&ReturnUrl=<%=_ReturnUrl %>" class="icon descbn">&nbsp</a></li>
                <li><a title="<%=LanguageUtility.GetLanguageText("MOVE", Session)%>" href="CommonPageContent.aspx?action=movemenu&g=<%=this.Request.QueryString["g"] %>&parentid=<%=parentID %>&id=<%=id %>&ReturnUrl=<%=_ReturnUrl %>" class="icon movbn">&nbsp</a></li>
                <li><a title="<%=LanguageUtility.GetLanguageText("EDIT", Session)%>" href="CommonPageContent.aspx?action=editmnu&g=<%=this.Request.QueryString["g"] %>&parentid=<%=parentID %>&mnuid=<%=id %>&ReturnUrl=<%=_ReturnUrl %>" class="icon editbn">&nbsp</a></li>
                <li><a title="<%=LanguageUtility.GetLanguageText("DELETE", Session)%>" href="CommonPageContent.aspx?action=deletemnu&g=<%=this.Request.QueryString["g"] %>&parentid=<%=parentID %>&mnuid=<%=id %>&ReturnUrl=<%=_ReturnUrl %>" class="icon deletebn" onclick="javascript: return confirm('<%=LanguageUtility.GetLanguageText("CONFIRM_DELETE", Session).Replace("<br />", "\\n")%>');">&nbsp</a></li>
            </ul>
        </td>
    </tr>
<%
    }
} %>
</table>